﻿# CMakeList.txt: pdf_tool 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)

# 将源代码添加到此项目的可执行文件。
add_executable (pdf_tool "pdf_tool.cpp" "pdf_tool.h" )

if (CMAKE_VERSION VERSION_GREATER 3.12)
  set_property(TARGET pdf_tool PROPERTY CXX_STANDARD 20)
endif()


target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32.lib)
#target_link_libraries(${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/freetype/objs/x64/Release Static/freetype.lib")
include_directories(${CMAKE_SOURCE_DIR}/stb_image)

target_link_libraries(${PROJECT_NAME} PRIVATE zlibstatic)
target_link_libraries(${PROJECT_NAME} PRIVATE png_static)
target_link_libraries(${PROJECT_NAME} PRIVATE podofo_static)

include_directories(${CMAKE_SOURCE_DIR}/podofo/src)
include_directories(${CMAKE_BINARY_DIR}/podofo)


# TODO: 如有需要，请添加测试并安装目标。

# 资源文件夹
set(RES_PATH ${CMAKE_SOURCE_DIR}/res)
# 目标文件夹
set(TEST_PATH ${CMAKE_BINARY_DIR}/pdf_tool/${CMAKE_CONFIGURATION_TYPES})

# 复制文件
add_custom_command(TARGET ${PROJECT_NAME}
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory ${RES_PATH} ${TEST_PATH})
